package com.itheima.test.lambda;

public class lambda01 {
    public static void main(String[] args) {
        Eatable eatable=new EatableImpl();
        useatable(eatable);
        useatable(new Eatable() {
            @Override
            public void eat() {
                System.out.println("匿名内部类");
            }
        });
        useatable(()->System.out.println("Lamb表达式"));
    }
    private static void useatable(Eatable e){
        e.eat();
    }
}
 interface Eatable{
    void eat();
}
class EatableImpl implements Eatable{
    @Override
    public void eat() {
        System.out.println("s实现类");
    }
}